/*
*  Copyright 2019-2023 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.information.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

/**
* @description /
* @author yiwei.he
* @date 2024-04-09
**/
@Data
@TableName("tz_article")
public class Article implements Serializable {

    @TableId(value = "id" , type = IdType.AUTO)
    @ApiModelProperty(value = "自增id")
    private Long id;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "封面")
    private String cover;

    @ApiModelProperty(value = "文章内容")
    private String articleContent;

    @ApiModelProperty(value = "浏览量")
    private Integer pageView;

    @ApiModelProperty(value = "简介")
    private String intro;

    @ApiModelProperty(value = "作者（这里应该是学校名称，哪一所院校发布的）")
    private String author;

    @ApiModelProperty(value = "标签（预留）")
    private String tag;

    @ApiModelProperty(value = "文章状态【1：草稿 2：已发布 3：废弃】")
    private Integer status;

    @ApiModelProperty(value = "文章类别【1：公招信息  2：培训考证  3：升学择校 4：招聘信息】")
    private Integer articleType;

    @ApiModelProperty(value = "是否删除【0：未删除 1：已删除】")
    private Integer isDelete;

    @ApiModelProperty(value = "发布时间")
    private LocalDateTime publishTime;

    @ApiModelProperty(value = "修改时间（仅仅记录发布后最后一次修改的时间）")
    private LocalDateTime updateTime;

    public void copy(Article source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
